package View;

import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractButton;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import main.LotusEngine;
import Game.AbstractGame;


@SuppressWarnings("serial")
public class GameMenuView extends JComponent
{
    LotusViewer myView;
    LotusEngine myEngine;
    AbstractGame myGame;


    public GameMenuView (LotusViewer view, AbstractGame game)
    {
        myView = view;
        createButtons();
    }


    private void createButtons ()
    {
        setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        c.gridy = 0;
        c.insets = new Insets(10, 10, 0, 0);
        
        JButton button =
            new JButton("Start Game");
        button.setVerticalTextPosition(AbstractButton.TOP);
        button.setHorizontalTextPosition(AbstractButton.CENTER);
        button.addActionListener(new ActionListener()
        {
            public void actionPerformed (ActionEvent e)
            {
                myView.swapView(new GamePlayView());
            }
        });

        add(button, c);

        c.gridy++;
        
        JButton button2 =
            new JButton("Load");
        button.setVerticalTextPosition(AbstractButton.TOP);
        button.setHorizontalTextPosition(AbstractButton.CENTER);
        button.addActionListener(new ActionListener()
        {
            public void actionPerformed (ActionEvent e)
            {
                myView.swapView(new GamePlayView());
            }
        });

        add(button2, c);

        c.gridy++;
        
        JButton button3 =
            new JButton("High Scores");
        button.setVerticalTextPosition(AbstractButton.TOP);
        button.setHorizontalTextPosition(AbstractButton.CENTER);
        button.addActionListener(new ActionListener()
        {
            public void actionPerformed (ActionEvent e)
            {
                myView.swapView(new GamePlayView());
            }
        });

        add(button3, c);

        c.gridy++;
    }

}
